import React, {Component} from 'react';
import styles from '../Message/index.less';
import CSSModules from 'react-css-modules';
import {Route, Link} from 'react-router-dom';

import AllArticles from './AllArticles';
import EditArticle from './EditArticle';
import Comment from './Comment';

class Article extends Component {
  constructor(props) {
    super(props);
    this.state = {
      list: [],
    };
  }

  render() {
    const {list} = this.state;
    const {match} = this.props;

    return (
      <div className={styles['home-wrap']}>
        <Route path={`${match.path}`} exact component={AllArticles} />
        <Route path={`${match.path}/edit/:articleId`} component={EditArticle} />
        <Route path={`${match.path}/add`} component={EditArticle} />
        <Route path={`${match.path}/comment/:articleId`} component={Comment} />
      </div>
    );
  }
}

export default Article;
